# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Jobs.V4.Model.ClientEvent do
  @moduledoc """
  An event issued when an end user interacts with the application that implements Cloud Talent Solution. Providing this information improves the quality of results for the API clients, enabling the service to perform optimally. The number of events sent must be consistent with other calls, such as job searches, issued to the service by the client.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Required. The timestamp of the event.
  *   `eventId` (*type:* `String.t`, *default:* `nil`) - Required. A unique identifier, generated by the client application.
  *   `eventNotes` (*type:* `String.t`, *default:* `nil`) - Notes about the event provided by recruiters or other users, for example, feedback on why a job was bookmarked.
  *   `jobEvent` (*type:* `GoogleApi.Jobs.V4.Model.JobEvent.t`, *default:* `nil`) - An event issued when a job seeker interacts with the application that implements Cloud Talent Solution.
  *   `requestId` (*type:* `String.t`, *default:* `nil`) - Strongly recommended for the best service experience. A unique ID generated in the API responses. It can be found in ResponseMetadata.request_id.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :eventId => String.t() | nil,
          :eventNotes => String.t() | nil,
          :jobEvent => GoogleApi.Jobs.V4.Model.JobEvent.t() | nil,
          :requestId => String.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:eventId)
  field(:eventNotes)
  field(:jobEvent, as: GoogleApi.Jobs.V4.Model.JobEvent)
  field(:requestId)
end

defimpl Poison.Decoder, for: GoogleApi.Jobs.V4.Model.ClientEvent do
  def decode(value, options) do
    GoogleApi.Jobs.V4.Model.ClientEvent.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Jobs.V4.Model.ClientEvent do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
